﻿<UserControl x:Class="VmroleAuthor.Views.ReferencedApplicationPayloadView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignWidth="500">   
    <Grid VerticalAlignment="Top" ShowGridLines="False">
        <Grid.RowDefinitions >           
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight ="30" />
            <RowDefinition Height="Auto" />          
            <RowDefinition MinHeight="30" />                    
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="30" />
        </Grid.RowDefinitions>           
        <TextBlock Grid.Row="0">Absolute or Relative Path</TextBlock>

        <Grid  Grid.Row="1" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBox Grid.Column="0" x:Name="RelativePath" Text="{Binding SelectedAppPayloadItemPath, Mode = TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" ></TextBox>
            <!-- Browse Button-->
            <Button Grid.Column="2" Margin="0" Padding="0" DockPanel.Dock="Right" MinWidth="50" Command="{Binding SelectApplicationPayloadCommand}">...</Button>
            <!-- Update Button-->
            <Button Grid.Column="4" Margin="0" Padding="0" DockPanel.Dock="Right" MinWidth="50" Command="{Binding UpdateApplicationPayloadCommand}">Update</Button>
        </Grid>
        <ContentPresenter Grid.Row="2" Content="{Binding ElementName=RelativePath, Path=(Validation.Errors).CurrentItem}" />

        <Grid  Grid.Row="3" VerticalAlignment="Center">
            <Grid.ColumnDefinitions>              
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBlock   Grid.Row="3" Grid.Column="0" >External</TextBlock>
            <CheckBox x:Name="IsExternal" Grid.Row="3" Grid.Column="2"  Style="{StaticResource ResourceKey=CheckBoxStyle}"  IsChecked="{Binding IsExternal, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}"/>            
        </Grid>
        <ContentPresenter Grid.Row="4"  Content="{Binding ElementName=IsExternal, Path=(Validation.Errors).CurrentItem}" />
      

        <Expander Grid.Row="5" Header="Details">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="6" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition MinHeight="30" />
                                       
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="6"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <TextBlock Grid.Row="1" Grid.Column="0">Payload Id</TextBlock>
                <TextBox x:Name="PayloadId" Grid.Row="1" Grid.Column="2" Text="{Binding PayloadId, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" />
                <ContentPresenter Grid.Row="2"  Grid.Column="2"  Content="{Binding ElementName=PayloadId, Path=(Validation.Errors).CurrentItem}" />                              
                            
            </Grid>
        </Expander>
      

    </Grid>
</UserControl>
